//
//  main.cpp
//  Mirstudy4
//
//  Created by 종헌 백 on 12. 1. 17..
//  Copyright (c) 2012년 backssi1@naver.com. All rights reserved.
//

#include <iostream>

using namespace std;
/*
    class Person {
        private :
            int age;
        
        public :
            void setAge(int temp);
            int getAge();
            char name[20];
            char phoneNum[20];
    };

int main ()
{
    Person man1;
    man1.setAge(27);
    
    cout<<man1.getAge();
    
    return 0;
}

void Person :: setAge(int temp )
{
    age = temp;
}

int Person :: getAge()
{
    return age;
}
*/

class Person{
    private : 
        char name[20];
        int phoneNum;

    public :
        void print();
        Person();
        Person (char* pName, int phoneNumber );   //constructor
        ~Person();  // destructor
    
};

int main()
{
    Person man1;
    Person man2 ( "박미르", 173507611 );
    
    man1.print();
    man2.print();
    
    return 0;
    
}

Person :: Person (char* pcName, int pcNumber )
{
    strcpy ( name , pcName );
    phoneNum = pcNumber;
    
}

Person :: Person ()
{
    strcpy (name, "x");
    phoneNum = 0;
}


Person :: ~Person(){
}

void Person :: print()
{
    cout<<"Name : "<<name<<endl;
    if(phoneNum == 0) 
        cout<<"phone : "<<phoneNum<<endl; 
    else
        cout<<"phone : 0"<<phoneNum<<endl; 
}